using System;
using System.Collections.Generic;
using System.Text;
using server.TypingServiceDataSetTableAdapters;

namespace server
{
    public class TypingServiceDataAccess
    {
        //start of typingentry usage
        public decimal InsertAuthor(string Email, string FirstName, string LastName, string Address, string City, string State, string Country, string ZipCode, string Phone, string Fax, string Church, string RecommendBy)
        {
            AuthorTableAdapter authorTableAdapter  = new AuthorTableAdapter();
            TypingServiceDataSet.AuthorDataTable authorDataTable = new TypingServiceDataSet.AuthorDataTable();
            authorDataTable.Rows.Add(1,Email, FirstName, LastName, Address, City, State, Country, ZipCode, Phone, Fax, Church, RecommendBy);
            authorDataTable.AcceptChanges();  
            authorTableAdapter.Update(authorDataTable);
            if (authorDataTable.Rows.Count == 1)
            {
                TypingServiceDataSet.AuthorRow row = authorDataTable.Rows[0] as TypingServiceDataSet.AuthorRow;
                return row.AuthorID;  
            }
            return -1;   
        }
        //end of typingentry usage
    }
}
